<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simGetObjectAssociatedWithScript</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1><a href="../apiOverview.htm">Regular API</a> function</h1>
<h3 class=subsectionBar><a name="simGetObjectAssociatedWithScript" id="simGetObjectAssociatedWithScript"></a>simGetObjectAssociatedWithScript / sim.getObjectAssociatedWithScript </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Retrives the handle of the object the script is attached to. See also <a href="simGetScriptAssociatedWithObject.htm">sim.getScriptAssociatedWithObject</a>, <a href="simGetCustomizationScriptAssociatedWithObject.htm">sim.getCustomizationScriptAssociatedWithObject</a> and <a href="simAssociateScriptWithObject.htm">sim.associateScriptWithObject</a>.<br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simGetObjectAssociatedWithScript(simInt scriptHandle)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>scriptHandle</strong>: handle of the script</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>Handle of the object that is associated with the script, or -1 if no object is associated with the script, or in case of an error.<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>number objectHandle=sim.getObjectAssociatedWithScript (number scriptHandle)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div><strong>scriptHandle</strong>: handle of the script, or sim.handle_self for the handle of the current script</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div><strong>objectHandle</strong>: handle of the object that the script is associated with, or -1 if the script is not associated (e.g. <a href="../mainScript.htm">main scripts</a> or <a href="../addOns.htm">add-ons</a> don't have associated objects).<br>
</div>
<div></div></td> 
</tr> 
</table> 

<br>
<p><a href="../apiFunctions.htm">All regular API functions on one page</a></p>
<br>
<br>
</td>
</tr>
</table>
</div>
</body>
</html>
